/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bs.ventas.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author ctrosch
 */
@Embeddable
public class ItemMovimientoVentaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "VTRMVI_MODFOR", nullable = false, length = 2)
    private String vtrmviModfor;
    @Basic(optional = false)
    @Column(name = "VTRMVI_CODFOR", nullable = false, length = 6)
    private String vtrmviCodfor;
    @Basic(optional = false)
    @Column(name = "VTRMVI_NROFOR", nullable = false)
    private int vtrmviNrofor;
    @Basic(optional = false)
    @Column(name = "VTRMVI_NROITM", nullable = false)
    private int vtrmviNroitm;
    @Basic(optional = false)
    @Column(name = "VTRMVI_DEBHAB", nullable = false, length = 1)
    private String vtrmviDebhab;

    public ItemMovimientoVentaPK() {
    }

    public ItemMovimientoVentaPK(String vtrmviModfor, String vtrmviCodfor, int vtrmviNrofor, int vtrmviNroitm, String vtrmviDebhab) {
        this.vtrmviModfor = vtrmviModfor;
        this.vtrmviCodfor = vtrmviCodfor;
        this.vtrmviNrofor = vtrmviNrofor;
        this.vtrmviNroitm = vtrmviNroitm;
        this.vtrmviDebhab = vtrmviDebhab;
    }

    public String getVtrmviModfor() {
        return vtrmviModfor;
    }

    public void setVtrmviModfor(String vtrmviModfor) {
        this.vtrmviModfor = vtrmviModfor;
    }

    public String getVtrmviCodfor() {
        return vtrmviCodfor;
    }

    public void setVtrmviCodfor(String vtrmviCodfor) {
        this.vtrmviCodfor = vtrmviCodfor;
    }

    public int getVtrmviNrofor() {
        return vtrmviNrofor;
    }

    public void setVtrmviNrofor(int vtrmviNrofor) {
        this.vtrmviNrofor = vtrmviNrofor;
    }

    public int getVtrmviNroitm() {
        return vtrmviNroitm;
    }

    public void setVtrmviNroitm(int vtrmviNroitm) {
        this.vtrmviNroitm = vtrmviNroitm;
    }

    public String getVtrmviDebhab() {
        return vtrmviDebhab;
    }

    public void setVtrmviDebhab(String vtrmviDebhab) {
        this.vtrmviDebhab = vtrmviDebhab;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (vtrmviModfor != null ? vtrmviModfor.hashCode() : 0);
        hash += (vtrmviCodfor != null ? vtrmviCodfor.hashCode() : 0);
        hash += (int) vtrmviNrofor;
        hash += (int) vtrmviNroitm;
        hash += (vtrmviDebhab != null ? vtrmviDebhab.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemMovimientoVentaPK)) {
            return false;
        }
        ItemMovimientoVentaPK other = (ItemMovimientoVentaPK) object;
        if ((this.vtrmviModfor == null && other.vtrmviModfor != null) || (this.vtrmviModfor != null && !this.vtrmviModfor.equals(other.vtrmviModfor))) {
            return false;
        }
        if ((this.vtrmviCodfor == null && other.vtrmviCodfor != null) || (this.vtrmviCodfor != null && !this.vtrmviCodfor.equals(other.vtrmviCodfor))) {
            return false;
        }
        if (this.vtrmviNrofor != other.vtrmviNrofor) {
            return false;
        }
        if (this.vtrmviNroitm != other.vtrmviNroitm) {
            return false;
        }
        if ((this.vtrmviDebhab == null && other.vtrmviDebhab != null) || (this.vtrmviDebhab != null && !this.vtrmviDebhab.equals(other.vtrmviDebhab))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.venta.modelo.ItemMovimientoVentaPK[vtrmviModfor=" + vtrmviModfor + ", vtrmviCodfor=" + vtrmviCodfor + ", vtrmviNrofor=" + vtrmviNrofor + ", vtrmviNroitm=" + vtrmviNroitm + ", vtrmviDebhab=" + vtrmviDebhab + "]";
    }

}
